<template>
	<view>
        <web-view v-if="pageInit" :src="webUrl"></web-view>
	</view>
</template>

<script>
    const api = require("@/static/js/api.js")
    const utils = require("@/static/js/utils.js")
    import {
        mapState,
        mapMutations,
        mapActions
    } from 'vuex';
    let that = null

    
	export default {
		data() {
			return {
                detailId: '',
                webUrl:'',
                pageInit: false
			};
		},
        
        computed: {
            ...mapState({
                hasLogin: state => state.userInfo.hasLogin,
                isAuthPhone: state => state.userInfo.isAuthPhone,
                isAuthUserInfo: state => state.userInfo.isAuthUserInfo, 
                isSeller: state => state.userInfo.isSeller,
                sellerObj: state => state.userInfo.sellerObj,
                buyerObj: state => state.userInfo.buyerObj,
                shopInfo: state => state.userInfo.shopInfo,
            }),
        },
        onLoad(options) {
            that = this;
            if (options.id){
                that.detailId = options.id;
                that.getHouseTypeDetail();
            }
        },
        onShow() {
      
        },
        methods:{ 
            ...mapMutations(['setUserInfo', 'setLoginStatus', 'setUserId',"setOrigin"]),

            getHouseTypeDetail() {
                let that = this
                api.getHouseTypeDetail({
                    param: {
                        id: that.detailId
                    }
                }).then(res => {
                    console.log(res)
                    if (res.success) {
                        if (res.data.vrUrl){                         
                            that.webUrl = res.data.vrUrl
                            that.pageInit = true
                        }                      
                    }
                })
            },
        }
	}
</script>

<style lang="scss">

</style>
